package com.simple.datax.vo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * The Class TbResourcesIdVO.
 */
@Embeddable
public class TbResourcesIdVO implements Serializable {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = -4427377982291416822L;

	/** The package string. */
	@Column(name = "PACKAGE")
	private String packageString;

	/** The key. */
	@Column(name = "KEY_ID")
	private String key;

	/** The locale. */
	@Column(name = "LOCALE")
	private String locale;

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
        result = prime * result + ((null == key) ? 0 : key.hashCode());
        result = prime * result + ((null == locale) ? 0 : locale.hashCode());
        result = prime * result + ((null == packageString) ? 0 : packageString.hashCode());
		return result;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(final Object obj) {
        boolean result = true;
		if (this == obj) {
            result = true;
        } else {
            if (null == obj) {
                result = false;
            } else {
                if (getClass() == obj.getClass()) {
                    final TbResourcesIdVO other = (TbResourcesIdVO) obj;
                    if (null == key) {
                        if (null != other.key) {
                            result = false;
		}
                    } else if (!key.equals(other.key)) {
                        result = false;
		}
                    if (null == locale) {
                        if (null != other.locale) {
                            result = false;
		}
                    } else if (!locale.equals(other.locale)) {
                        result = false;
                    }
                    if (null == packageString) {
                        if (null != other.packageString) {
                            result = false;
			}
		} else if (!packageString.equals(other.packageString)) {
                        result = false;
		}
                } else {
                    result = false;
			}
		}
			}
        return result;
	}

	/**
	 * Gets the package string.
	 * 
	 * @return the package string
	 */
	public String getPackageString() {
		return packageString;
	}

	/**
	 * Sets the package string.
	 * 
	 * @param packageString
	 *            the new package string
	 */
	public void setPackageString(final String packageString) {
		this.packageString = packageString;
	}

	/**
	 * Gets the key.
	 * 
	 * @return the key
	 */
	public String getKey() {
		return key;
	}

	/**
	 * Sets the key.
	 * 
	 * @param key
	 *            the new key
	 */
	public void setKey(final String key) {
		this.key = key;
	}

	/**
	 * Gets the locale.
	 * 
	 * @return the locale
	 */
	public String getLocale() {
		return locale;
	}

	/**
	 * Sets the locale.
	 * 
	 * @param locale
	 *            the new locale
	 */
	public void setLocale(final String locale) {
		this.locale = locale;
	}
}